<link rel="stylesheet" href="../addons/jy_jdk/custom/templates/mobile/css/tbk.css?v=8" type="text/css">
<div id="wrap_list" style="display: block;high:100%;width:100%">
  <div class="search" style="position:fixed;top:0px;z-index:999;">
    <div class="search-box"> <span ng-click="pagedata.k=0;getlist(pagedata.keyword)" class="search-icon"></span>
      <input class="search-ipt" name="keyword" value='' id="searchenter" placeholder="请输入关键词.." type="text" ng-model="pagedata.keyword" >
      
    </div>
   
	<a href="javascript:;"><i class="search-cancel f14 icon jinyunicon icon-saoyisao2" id="scancode" style="font-size: 1.0rem;"></i></a>
  <dl class="recommend"  >
    <dd style="padding-top: .4rem;">
      <div class="listinfo">
        <ul  id="hear">
          <li ng-class="{'active':pagedata.k==0}"  ng-click="pagedata.k=0;getlist()" style="width: auto;" sorts="0"><a href="####">智能排序</a></li>
          <li  ng-class="{'active':pagedata.k==1}"  ng-click="pagedata.k=1;getlist(pagedata.keyword,'jiage')" style="width: auto;" sorts="99"><a href="####">价格</a></li>
          <li  ng-class="{'active':pagedata.k==2}"  ng-click="pagedata.k=2;getlist(pagedata.keyword,'zy')" style="width: auto;" sorts="99"><a href="####">自营</a></li>
          
        </ul>
      </div>
    </dd>
  </dl>
  <div class="results" style="padding-top:3.6rem;">
    <ul id="goodlist" style="padding:0 0.3rem">
    <div ng-repeat="item in pagedata.list" class="merchgroup" id="goods-tmpl" type="text/x-dot-template">
		<li class="flex" ng-click="access_json('/detail//id='+item.id)">
			<div class="result-img"> <a href="####" style="color:#fff" class="new-coupon"> <img src="{{tomedia(item.imgUrl)}}" alt=""> </a> </div>
			<div class="result-desc">
			  <h3 class="f14" style="width: auto;">
			  <a href="####" style="color:#404040">
			   <img ng-if="item.isJdSale!=1" src="../addons/jy_jdk/custom/templates/mobile/img/jd.png" alt="" class="jd-icons">
                   
               <img  ng-if="item.isJdSale==1" src="../addons/jy_jdk/custom/templates/mobile/img/jd-icon.png" alt="" class="jd-icon">
			  {{item.goodsName}}
			  </a>
			  
			  </h3> 
			 <p class="f13">价格 ¥ <strong class="f16">{{item.wlUnitPrice}}</strong></p>
			   <!--<p class="f13">现价 ¥<del>{{item.wlUnitPrice}}</del> </p>
			 <p class="f13"><label class="styel-fonts">券</label>¥ <strong class="f16">8</strong></p>
			  <p class="f13">券后价 ¥ <strong class="f16">{{item.wlPrice_after}}</strong></p>-->
			  
			
			  
			  <div class="right"> <div class="text">查看详情</div>																						
                                          
            </div>
			</div>
		  </li>
		
	</div>
		</ul>
		<div id="nodata" class="" ><div class="dropload-load">没有更多了，换个关键词在试试吧</div></div>
  </div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
wx.ready(function () {
	$("#scancode").on('click',function () {
			wx.scanQRCode({
				needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
				scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
				success: function (res) {
							//无需返回结果！					
						}
			});
	});
});
scope.scroll(function(){
		scope.$apply();
		setTimeout('getlist()',2000);
	},false,'svposttext');
	var page = 1;
	scope.getlist=function (key,type){
		var params = {
					'plugin':'jy_jdk',
					'action':'searchlist',
					'op':'list',
					'data':{
						'keyword':key,
						'type':type,
					},
					'callback':function(data){
							if(data.error !=1){
							 for (var i=0;i<data.list.length;i++){
									scope.pagedata.list.push(data.list[i]);
								}
								if(page >1){
									$(".merchgroup").animate({scrollTop:0},300);
								}
								page++;
								scope.loading = false;
								window.scope.pagedata.list=data.list;
								scope.$apply();
							}else{
								onsole.log('error');
							};
					}
		}
		scope.post_json(params);
}
</script>